/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.pacis.shca.domain.entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author solriver
 */
@Entity
@Table(name = "ocupacion", catalog = "bdshca")
@NamedQueries({
    @NamedQuery(name = "Ocupacion.findAll", query = "SELECT o FROM Ocupacion o"),
    @NamedQuery(name = "Ocupacion.findByIdOcupacion", query = "SELECT o FROM Ocupacion o WHERE o.idOcupacion = :idOcupacion"),
    @NamedQuery(name = "Ocupacion.findByOcuNombreTrabajo", query = "SELECT o FROM Ocupacion o WHERE o.ocuNombreTrabajo = :ocuNombreTrabajo"),
    @NamedQuery(name = "Ocupacion.findByOcuEstudia", query = "SELECT o FROM Ocupacion o WHERE o.ocuEstudia = :ocuEstudia"),
    @NamedQuery(name = "Ocupacion.findByOcuTrabaja", query = "SELECT o FROM Ocupacion o WHERE o.ocuTrabaja = :ocuTrabaja"),
    @NamedQuery(name = "Ocupacion.findByOcuTrabajoLugar", query = "SELECT o FROM Ocupacion o WHERE o.ocuTrabajoLugar = :ocuTrabajoLugar"),
    @NamedQuery(name = "Ocupacion.findByOcuParticipacionSocial", query = "SELECT o FROM Ocupacion o WHERE o.ocuParticipacionSocial = :ocuParticipacionSocial")})
public class Occupation implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_ocupacion")
    private Integer id;
    @Column(name = "ocu_nombre_trabajo")
    private String name;
    @Column(name = "ocu_estudia")
    private Boolean studies;
    @Column(name = "ocu_trabaja")
    private Boolean works;
    @Column(name = "ocu_trabajo_lugar")
    private String workPlace;
    @Column(name = "ocu_participacion_social")
    private String socialParticipation;
    @JoinColumn(name = "vis_id_visita_domiciliaria", referencedColumnName = "id_visita_domiciliaria")
    @ManyToOne(optional = false)
    private HomeVisit homeVisit;
    @JoinColumn(name = "mie_id_miembro", referencedColumnName = "id_miembro")
    @ManyToOne(optional = false)
    private Member member;

    public Occupation() {
    }

    public Occupation(Integer idOcupacion) {
        this.id = idOcupacion;
    }

    public Integer getIdOcupacion() {
        return id;
    }

    public void setIdOcupacion(Integer idOcupacion) {
        this.id = idOcupacion;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Boolean getStudies() {
        return studies;
    }

    public void setStudies(Boolean studies) {
        this.studies = studies;
    }

    public Boolean getWorks() {
        return works;
    }

    public void setWorks(Boolean works) {
        this.works = works;
    }

    public String getWorkPlace() {
        return workPlace;
    }

    public void setWorkPlace(String workPlace) {
        this.workPlace = workPlace;
    }

    public String getOcuParticipacionSocial() {
        return socialParticipation;
    }

    public void setSocialParticipation(String socialParticipation) {
        this.socialParticipation = socialParticipation;
    }

    public HomeVisit getHomeVisit() {
        return homeVisit;
    }

    public void setHomeVisit(HomeVisit homeVisit) {
        this.homeVisit = homeVisit;
    }

    public Member getMember() {
        return member;
    }

    public void setMember(Member member) {
        this.member = member;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Occupation)) {
            return false;
        }
        Occupation other = (Occupation) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.pacis.shca.domain.entity.Occupation[ id=" + id + " ]";
    }
    
}
